<?php


// 文件上传
	if ($_REQUEST ['m'] == 'FileUpload' && $_REQUEST ['a'] == 'doUpload') {
	{
		header("Content-Type:text/html; charset=utf-8");
		if(intval($_SESSION['user_id'])==0)
		{
			echo "<script>alert(".a_l("HC_PLEASE_REG_OR_REGISTER").");</script>"; exit;
		}
		require (ROOT_PATH . 'app/source/class/file.php');
		$list = uploadFile(0,'kind');
		if(is_array($list))
		{
			$file_url = ".".$list[0]['recpath'].$list[0]['savename'];
			$html = '<html>';
			$html.= '<head>';
			$html.= '<title>Insert Image</title>';
			$html.= '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
			$html.= '</head>';
			$html.= '<body>';
			$html.= '<script type="text/javascript">';
			$html.= 'parent.parent.KE.plugin["image"].insert("' . $_POST['id'] . '", "' . $file_url . '","' . $_POST['imgTitle'] . '","' . $_POST['imgWidth'] . '","' . $_POST['imgHeight'] . '","' . $_POST['imgBorder'] . '","' . $_POST['align'] . '");';
			$html.= '</script>';
			$html.= '</body>';
			$html.= '</html>';
			echo $html;
		}
		else
		{
			echo "<script>alert('".a_L('UPLOAD_PIC_ERR')."');</script>";
		}
	}
}
?>